#pragma once
#include "ridefactory.h"
#include "SgObject.h"
#include "SgComposite.h"
#include "graphics/Texture.h"
class CSgRotate;
class CSgRotateAroundPoint;
class CSgTranslate;
class CSgMaterial;

const unsigned NUM_SPOKES = 20;
const unsigned NUM_SEATS = 20;
const unsigned NUM_SIDES = 60;

const float SEAT_HEIGHT = 0.1f;
const float SIDE_HEIGHT = 0.02f;
const float SEAT_DEPTH = 0.02f;
const float SEAT_BOTTOM_OFFSET = 0.05f;
const float SIDE_DEPTH = 0.2f;
const float SIDE_WIDTH = 1.0f;

const float SIGN_HEIGHT = 6.0f; // WARNING: if you change this, change NUM_LIGHTS_Y to the (unsigned) of it, too. sign [top, bottom]
const float SIGN_DEPTH = 6.0f; // NUM_LIGHTS_X: sign [left, right]
const float SIGN_WIDTH = 0.5f;

const unsigned NUM_LIGHTS_X = 6;
const unsigned NUM_LIGHTS_Y = 6;

/*const float SEAT_HEIGHT = 0.1f;
const float SIDE_HEIGHT = 0.2f;
const float SEAT_DEPTH = 0.2f;
const float SEAT_BOTTOM_OFFSET = 0.05f;
const float SIDE_DEPTH = 0.3f;*/

class FerrisWheelFactory :
	public RideFactory
{
public:
	FerrisWheelFactory(void);
	~FerrisWheelFactory(void);

	virtual CSgObject * Create();
	virtual void AdvanceTime(const DWORD &, const DWORD &);

private:
	CSgPtr<CSgComposite> MakeSeat();
	CSgPtr<CSgComposite> MakeSign();

	double m_wheelRotateDegrees;
	CSgPtr<CSgComposite> m_FerrisWheel;
	CTexture * m_texture1;
	CTexture * m_texture2;
	CTexture * m_texture3;
	CTexture * m_texturesign;

	// animation points
	CSgPtr<CSgRotateAroundPoint> m_rotate_point_1;
	CSgPtr<CSgRotateAroundPoint> m_rotate_point_2[NUM_SEATS];
	CSgPtr<CSgRotate> m_rotate_point_3[NUM_SEATS];
	CSgPtr<CSgTranslate> m_rotate_point_4[NUM_SEATS];
	CSgPtr<CSgRotateAroundPoint> m_rotate_point_5;

	CSgPtr<CSgMaterial> m_sign_mat_top[NUM_LIGHTS_Y];
	CSgPtr<CSgMaterial> m_sign_mat_bottom[NUM_LIGHTS_Y];
	CSgPtr<CSgMaterial> m_sign_mat_left[NUM_LIGHTS_X];
	CSgPtr<CSgMaterial> m_sign_mat_right[NUM_LIGHTS_X];
};